/*  This file is part of the comicconquer project
    Copyright (C) 2010 Reach <reach334@gmail.com>

    ComicConquer is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This software is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public 
    License along with this software.  If not, see <http://www.gnu.org/licenses/>.

*/

#ifndef COTABPAGE_H
#define COTABPAGE_H

#include "mist.h"
#include "CoGroupBox.h"

/**
 * Page display in setting dialog. Can easily add some kinds of widget. 
 * 
 * @author reach (5/25/2010)
 */
class CoTabPage : public QWidget
{
    Q_OBJECT

    //-- constructor
public:
    CoTabPage(QWidget* parent = 0);

    //-- public methods
public:
    CoGroupBox* addGroupBox(const QString& name, const QString& text);
    CoGroupBox* getGroupBox(const QString& name);
    QWidget* addWidget(const QString& name, QWidget* widget);
    QWidget* getWidget(const QString& name);
    QWidget* getWidget(int id);
    CoCheckButton* getCheckButton(const QString& groupBoxName, const QString& widgetName);
    CoRadioButtonGroup* getRadioButtonGroup(const QString& groupBoxName, const QString& widgetName);
    CoNumberEditor* getNumberEditor(const QString& groupBoxName, const QString& widgetName);
    void addStretch(int stretch = 0);
    void clear();

    //-- public slots
public slots:

    //-- protected members
protected:
    QVBoxLayout m_layout;
    QMap<QString, QWidget*> m_widgetMap;
    QVector<QWidget*> m_widgetVec;
    int m_curFocusWidget;
    
};

#endif // COTABPAGE_H
